<template>
  <div class="container">
    <div class="head">
     <div class="text">
      <img src="@/assets/sj_userIcon.35316a08.png" alt="">
      <h3>{{ xinxi.name }}</h3>
      <p>司机编号：<span>{{ xinxi.number }}</span></p>
      <p>手机号：{{ xinxi.phone }}</p>
     </div>
    </div>
    <div class="car">
      <div class="gridT">
        <p>-本月任务-</p>
        <van-grid column-num="3" :border="false">
          <van-grid-item  >
            <p>0</p>
            <p>任务总量</p>
            </van-grid-item>
            <van-grid-item  >
            <p>0</p>
            <p>完成任务量</p>
            </van-grid-item>  <van-grid-item  >
            <p>0</p>
            <p>运输里程(km)</p>
            </van-grid-item>
        </van-grid>
      </div>
      <div class="cellT">
        <van-cell title="车辆信息" is-link  to="/car" />
        <van-cell title="任务数据" is-link to="/calendar"/>
        <van-cell title="系统设置" is-link />
      </div>
    </div>
  </div>
</template>

<script>
import { user } from '@/api/user'

export default {
  name: 'HomeIndex',
  data () {
    return {
      xinxi: {}
    }
  },
  created () {
    this.getUser()
  },
  methods: {
    async getUser () {
      const res = await user()
      console.log(res)
      this.xinxi = res.data.data
    }
    // 车辆信息

  }
}
</script>

<style scoped lang="less">
.container {
  background-color: rgb(245, 245, 245);
  height: 100%;
  position: relative;

  .head {
    overflow: hidden;
    height: 42vh;
    color: white;
    padding: 10px 0 20px;
    text-align: center;
    position: relative;
    img {
      width: 65px;
      height: 65px;
    }
  &:before{

    background-color: #EF4F3F !important;
    content: "";
    position: absolute;
    left: -50%;
    z-index: 1;
    width: 200vw;
    border-radius: 100%;
    bottom: 0;
    height: 80vh;
    }
    .text{
    width: 80%;
    position: absolute;
    left: 50%;
    transform: translate(-50%);
    bottom: 6.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
    line-height: .2;
    }
  }

  .car {
    width: 90%;
    position: absolute;
    z-index: 6;
    // bottom: 30px;
    margin-bottom: 200px;
    text-align: start;
    margin: -70px 18px;
    border-radius: 10px;

    .gridT{
    background-color: #fff;
    height: 140px;
    padding: 13px 24px;
    border-radius: 12px;
      p{
        height: 30px;
        text-align: center;
        line-height: 30px;
        margin: 0;
      }
      .van-grid{

        p:nth-child(1){
          height: 50px;
          line-height: 50px;
          font-weight: 700;
        }
        p:nth-child(2){
          // height: 34px;
          // line-height: 34px;
          font-size: 12px;
          // padding: 0 0 10px;
        }
      }
    }
    .cellT{
    border-radius: 12px;

    background-color: #fff;
      margin-top: 20px;
    }
  }
}
 span{
    font-size: 16px;

    }
</style>
